﻿using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using KPIS.GERP.GHRMS.BLL;
using KPIS.GERP.GHRMS.IBLL;
using KPIS.GERP.GHRMS.MODEL;

namespace KPIS.GERP.GHRMS.APP.App_UI.Forms
{
    public partial class ES_MoveRequest : System.Web.UI.Page
    {
        private SsMng ssMng = new SsMng();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.QueryString["sta"] != null)
                    this.lblSta.Text = Request.QueryString["sta"].ToString();

                lblEmpSeq.Text = ssMng.EmpSeq;
                LoadDataGrid();
            }

        }
        public void LoadDataGrid()
        {                      
            DataTable dt;
            MoveRequestBLL obj = new MoveRequestBLL();
            dt = obj.select(int.Parse(lblEmpSeq.Text)); 
                

            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();


        }

        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                int seq = Convert.ToInt32((e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["req_seq"]);

                MoveRequestMainBLL obj = new MoveRequestMainBLL();
                obj.Delete(seq, 1);
           
            }
            LoadDataGrid();
        }

        
    }
}
